package LineCode.网易经典.test2;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> xList = new ArrayList<>();
        List<Integer> yList = new ArrayList<>();

//        int[] x = new int[n];
//        int[] y = new int[n];
        int[] reslut = new int[n];
        for (int i = 0; i < n; i++) {
            xList.add(sc.nextInt());
        }
        for (int i = 0; i < n; i++) {
            yList.add(sc.nextInt());
        }
        for (int i = n-1; i >= 0; i--) {
            Point center = getCenterPoint(xList, yList);
            reslut[i] = getStep(center, xList, yList);
            delLengthPoint(center, xList, yList);
        }
        for (int i = 0; i < n-1; i++) {
            System.out.print(reslut[i] + " ");
        }

        System.out.print(reslut[n-1]);

    }

    //剔除最远项
    public static void delLengthPoint(Point center, List<Integer> xs, List<Integer> ys) {
        int deli = 0;
        int delLength = 0;
        for (int i = 0; i < xs.size(); i++) {
            int length = Math.abs(center.x - xs.get(i)) + Math.abs(center.y - ys.get(i));
            if (length > delLength) {
                delLength = length;
                deli = i;
            }
        }
        xs.remove(deli);
        ys.remove(deli);
    }

    //获取总步数
    public static int getStep(Point center, List<Integer> xs, List<Integer> ys) {
        int res = 0;
        for (int i = 0; i < xs.size(); i++) {
            res += Math.abs(center.x - xs.get(i)) + Math.abs(center.y - ys.get(i));
        }
        return res;
    }

    //获取中心点
    public static Point getCenterPoint(List<Integer> xs, List<Integer> ys) {
        Integer xc = 0, yc = 0;
        for (Integer x: xs) { xc += x; }
        for (Integer y: ys) { yc += y; }
        xc = new Double(xc/xs.size()).intValue();
        yc = new Double(yc/ys.size()).intValue();
        return new Point(xc, yc);
    }

    static class Point {
        int x;
        int y;

        public Point() {
        }

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
}